Next | Prev | Up | Top | Contents | Index
Arithmetic with long Types
Code that does arithmetic (including shifting), and code that may overflow 32 bits and assumes particular treatment of the overflow (for example, truncation), can exhibit different behavior, depending on the mix of types involved (including signedness).
Similarly, implicit casting in expressions that mix int and long values may produce unexpected results due to sign/zero extension. An int constant is sign- or zero-extended when it occurs in an expression with long values.
Next | Prev | Up | Top | Contents | Index